#include "renderer/camera.h"

Camera::Camera(){
    x = -3;
    y = -2;
    z = -5.0;
    rz = 0;
    rx = 24;
}

void Camera::ProcessKey(int key){
    if(key == 'S'){
        Movey(0.5);
    }
    if(key == 'W'){
        Movey(-0.5);
    }
    if(key == 'A'){
        Movex(0.5);
    }
    if(key == 'D'){
        Movex(-0.5);
    }
    if(key == 'F'){
        Movez(0.5);
    }
    if(key == 'R'){
        Movez(-0.5);
    }
    if(key == 'Z'){
        Rotatez(2);
    }
    if(key == 'X'){
        Rotatez(-2);
    }
    if(key == 'T'){
        Rotatex(2);
    }
    if(key == 'G'){
        Rotatex(-2);
    }
}

void Camera::glTranslate(){
    glRotatef(rx, 1, 0, 0);
    glRotatef(rz, 0, 0, 1);
    glTranslatef(x, y, z);
}
